﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MyWeb.ServiceBus.Model.Models;

namespace MyWeb.ServiceBus.Model
{
    [SysTable]
    [Table("RequestLog")]
    public class RequestLog:Root<long>
    {
        /// <summary>
        /// 应用Id
        /// </summary>
        public long ApplicationId { get; set; }
        /// <summary>
        /// 服务Id
        /// </summary>
        public long SysServiceId { get; set; }
        /// <summary>
        /// 服务版本Id
        /// </summary>
        public long GatewayId { get; set; }
        /// <summary>
        /// 调用方应用Id
        /// </summary>
        public long CallerAppId { get; set; }
        /// <summary>
        /// 请求头
        /// </summary>
        public string Headers { get; set; } = string.Empty;
        /// <summary>
        /// 响应头
        /// </summary>
        public string Response { get; set; } = string.Empty;
        /// <summary>
        /// 请求目标地址
        /// </summary>
        public string UrlReferrer { get; set; } = string.Empty;
        /// <summary>
        /// 请求报文
        /// </summary>
        public string RequestParam { get; set; } = string.Empty;
        /// <summary>
        /// 响应报文
        /// </summary>
        public string ResultParam { get; set; } = string.Empty;
        /// <summary>
        /// 请求报文长度
        /// </summary>
        public long RequestLen { get; set; }
        /// <summary>
        /// 响应报文长度
        /// </summary>
        public long ResultLen { get; set; }
        /// <summary>
        /// 前端请求开始时间
        /// </summary>
        public DateTime ForeStartTime { get; set; }
        /// <summary>
        /// 前端请求结束时间
        /// </summary>
        public DateTime ForeEndTime { get; set; }
        /// <summary>
        /// 后端请求开始时间
        /// </summary>
        public DateTime RearStartTime { get; set; }
        /// <summary>
        /// 后端请求结束时间
        /// </summary>
        public DateTime RearEndTime { get; set; }
        /// <summary>
        /// 前端请求耗时
        /// </summary>
        public double EsbCostTime { get; set; }
        /// <summary>
        /// 后端请求耗时
        /// </summary>
        public double CostTime { get; set; }
    }
}
